require(['./config'], () => {
    require(['url','template','header','footer'], (url, template) => {
        class Category {
            constructor () {
                this.renderlist()
            }
            renderlist () {
                const id = location.search.slice(4)
                $.get(`${url.xmyxBaseUrl}/tab/${id}`,{start: 0}, resp => {
                    if(resp.code === 200) {
                        const { cname } = resp.data.category
                        let { list } = resp.data.items
                        list = list.filter (shop => shop.title)
                        $('#catecent').html(template('categorytemplate',{list}))
                        $('#catetop').html(template('ptemplate', {cname}))
                    }
                })
            }
        }
        new Category ()
    })
})